{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This notebook provides examples of the return values for the hgvs data provider"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime\n",
    "import json\n",
    "\n",
    "from hgvs.dataproviders.uta import connect\n",
    "hdp = connect()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def json_encoder(o):\n",
    "    if isinstance(o, datetime.datetime):\n",
    "        return o.isoformat()\n",
    "    # o must be serializable\n",
    "    return o\n",
    "def print_json(data):\n",
    "    if type(data) is list:\n",
    "        ddata = [dict(d) for d in data]\n",
    "    else:\n",
    "        ddata = dict(data)\n",
    "    return print(json.dumps(ddata, default=json_encoder, indent=4, sort_keys=True))\n",
    "pj = print_json"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_acs_for_protein_seq (DEPRECATED)\n",
    "\n",
    "Uses:\n",
    "* hgvs/utils/reftranscriptdata.py"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_gene_info\n",
    "\n",
    "Uses: Not used in hgvs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\n",
      "    \"added\": \"2014-02-10T22:59:21.153414\",\n",
      "    \"aliases\": \"{HRCA1,RCA1,VHL1,pVHL}\",\n",
      "    \"descr\": \"von Hippel-Lindau tumor suppressor\",\n",
      "    \"hgnc\": \"VHL\",\n",
      "    \"maploc\": \"3p25.3\",\n",
      "    \"summary\": \"von Hippel-Lindau tumor suppressor\"\n",
      "}\n"
     ]
    }
   ],
   "source": [
    "pj(hdp.get_gene_info(\"VHL\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_seq\n",
    "\n",
    "Uses:\n",
    "* hgvs/validator.py\n",
    "* hgvs/normalizer.py\n",
    "* hgvs/utils/reftranscriptdata.py\n",
    "* hgvs/utils/context.py\n",
    "* hgvs/variantmapper.py\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'CCTAGAATGGGGGTGGGGTGGGGTGGGGTGGGCTGGACAGAAGAGAGGAGGAGAAGGAGGTGACTGAGGGGACTGCAGCTGGGTGGGCGGTAACCGAGGGGAGGGGAACTGGTGGCGTCCCCATCTCGCGGGGTCCGGAACGGCGACGCGCCCGCGCCCAGCTGATTGGAGCCCTTCAGGCCTCCCGCGCCCGACCGGCAGCCCAATCCTATAAAGCTTCCTCTAAGCTGGGCCCTCCGCAAACGGGATCCAGAGAGGCTCGCGCCTTGCTTGCTAAGGAACCATGACCGGCCGGGACTCGCTTTCCGACGGGCGCACTAGCAGCAGGGCGCTGGTGCCTGGCGGTTCCCCTAGGGGCTCGCGCCCCCGGGGCTTCGCCATCACGGACCTGCTGGGCTTGGAGGCCGAGCTGCCGGCGCCCGCTGGCCCAGGACAGGGATCTGGCTGCGAGGGTCCGGCAGTCGCGCCGTGCCCGGGCCCGGGGCTTGACGGCTCCAGCCTGGCGCGTGGGGCCCTACCGCTGGGACTCGGCCTCCTCTGTGGCTTCGGCACGCAGCCGCCGGCGGCCGCTCGAGCACCCTGCCTGCTCCTAGCGGACGTGCCGTTCCTGCCGCCCAGGGGCCCCGAGCCCGCTGCCCCGCTGGCTCCCAGCCGTCCGCCGCCTGCGCTCGGCCGCCAGAAGCGCAGCGACAGCGTCTCCACGTCCGATGAGGACAGCCAGTCTGAAGACAGGAATGACCTAAAGGCATCCCCCACCTTGGGCAAGAGGAAGAAGCGGCGGCACAGGACAGTTTTCACTGCTCACCAGCTGGAAGAGTTGGAGAAGGCATTCAGCGAGGCCCACTACCCTGATGTGTATGCCCGAGAAATGCTGGCTGTGAAAACTGAGCTCCCCGAAGACCGGATACAGGTGTCTGGGGTCCCTTTTCTCCGCTCCAAAGATACCACAGAGAACGTGTCATTCCCACATTCAGTGAGCCAATCAGCAGTCCCTTCTCTATAGCCAACACGCTCCCTTTGCATAGAAACTGAGGGTCCCTTAGCTGAAGGCACCACAAGAGCTTGCCCCTATGACCCTCATGCCTTTTTTCATTTTATTATTATTTAGTATCAAATCATTCTTTAAAATCACATGATAATGTGTGCTGCAACTAGAAACTATAAAGATATGTCAATGAAAAAAAAAAAAAAGAGAC'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hdp.get_seq(\"NM_199425.2\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_tx_exons\n",
    "\n",
    "Uses:\n",
    "* hgvs/normalizer.py\n",
    "* hgvs/alignmentmapper.py\n",
    "* hgvs/transcriptmapper.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.10\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"alt_aseq\": null,\n",
      "        \"alt_end_i\": 25059588,\n",
      "        \"alt_exon_id\": 2999028,\n",
      "        \"alt_exon_set_id\": 298679,\n",
      "        \"alt_start_i\": 25059178,\n",
      "        \"alt_strand\": -1,\n",
      "        \"cigar\": \"410=\",\n",
      "        \"exon_aln_id\": 1148619,\n",
      "        \"hgnc\": \"VSX1\",\n",
      "        \"ord\": 2,\n",
      "        \"tx_ac\": \"NM_199425.2\",\n",
      "        \"tx_aseq\": null,\n",
      "        \"tx_end_i\": 1196,\n",
      "        \"tx_exon_id\": 936834,\n",
      "        \"tx_exon_set_id\": 98390,\n",
      "        \"tx_start_i\": 786\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.10\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"alt_aseq\": null,\n",
      "        \"alt_end_i\": 25060150,\n",
      "        \"alt_exon_id\": 2999027,\n",
      "        \"alt_exon_set_id\": 298679,\n",
      "        \"alt_start_i\": 25060071,\n",
      "        \"alt_strand\": -1,\n",
      "        \"cigar\": \"79=\",\n",
      "        \"exon_aln_id\": 1148632,\n",
      "        \"hgnc\": \"VSX1\",\n",
      "        \"ord\": 1,\n",
      "        \"tx_ac\": \"NM_199425.2\",\n",
      "        \"tx_aseq\": null,\n",
      "        \"tx_end_i\": 786,\n",
      "        \"tx_exon_id\": 936833,\n",
      "        \"tx_exon_set_id\": 98390,\n",
      "        \"tx_start_i\": 707\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.10\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"alt_aseq\": null,\n",
      "        \"alt_end_i\": 25063015,\n",
      "        \"alt_exon_id\": 2999026,\n",
      "        \"alt_exon_set_id\": 298679,\n",
      "        \"alt_start_i\": 25062308,\n",
      "        \"alt_strand\": -1,\n",
      "        \"cigar\": \"707=\",\n",
      "        \"exon_aln_id\": 1148596,\n",
      "        \"hgnc\": \"VSX1\",\n",
      "        \"ord\": 0,\n",
      "        \"tx_ac\": \"NM_199425.2\",\n",
      "        \"tx_aseq\": null,\n",
      "        \"tx_end_i\": 707,\n",
      "        \"tx_exon_id\": 936832,\n",
      "        \"tx_exon_set_id\": 98390,\n",
      "        \"tx_start_i\": 0\n",
      "    }\n",
      "]\n"
     ]
    }
   ],
   "source": [
    "pj(hdp.get_tx_exons(\"NM_199425.2\", \"NC_000020.10\", \"splign\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_tx_for_gene\n",
    "\n",
    "Uses: Not used by HGVS (but useful)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[\n",
      "    {\n",
      "        \"alt_ac\": \"AC_000135.1\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 855,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_000551.3\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.11\",\n",
      "        \"alt_aln_method\": \"blat\",\n",
      "        \"cds_end_i\": 855,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_000551.3\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.11\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 855,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_000551.3\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.12\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 855,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_000551.3\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_018914.2\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 855,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_000551.3\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NG_008212.3\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 855,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_000551.3\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"AC_000135.1\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 732,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_198156.2\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.11\",\n",
      "        \"alt_aln_method\": \"blat\",\n",
      "        \"cds_end_i\": 732,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_198156.2\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.11\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 732,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_198156.2\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.12\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 732,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_198156.2\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_018914.2\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 732,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_198156.2\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.11\",\n",
      "        \"alt_aln_method\": \"genebuild\",\n",
      "        \"cds_end_i\": 1482,\n",
      "        \"cds_start_i\": 840,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"ENST00000256474\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.11\",\n",
      "        \"alt_aln_method\": \"genebuild\",\n",
      "        \"cds_end_i\": 579,\n",
      "        \"cds_start_i\": 60,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"ENST00000345392\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.11\",\n",
      "        \"alt_aln_method\": \"genebuild\",\n",
      "        \"cds_end_i\": null,\n",
      "        \"cds_start_i\": null,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"ENST00000477538\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.11\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 795,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_001354723.1\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000003.12\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"cds_end_i\": 795,\n",
      "        \"cds_start_i\": 213,\n",
      "        \"hgnc\": \"VHL\",\n",
      "        \"tx_ac\": \"NM_001354723.1\"\n",
      "    }\n",
      "]\n"
     ]
    }
   ],
   "source": [
    "pj(hdp.get_tx_for_gene(\"VHL\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_tx_for_region\n",
    "\n",
    "Uses:\n",
    "* hgvs/assemblymapper.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.10\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"alt_strand\": -1,\n",
      "        \"end_i\": 25063015,\n",
      "        \"start_i\": 25051520,\n",
      "        \"tx_ac\": \"NM_001256272.1\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.10\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"alt_strand\": -1,\n",
      "        \"end_i\": 25063015,\n",
      "        \"start_i\": 25051520,\n",
      "        \"tx_ac\": \"NR_045948.1\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.10\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"alt_strand\": -1,\n",
      "        \"end_i\": 25063015,\n",
      "        \"start_i\": 25056071,\n",
      "        \"tx_ac\": \"NM_014588.5\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.10\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"alt_strand\": -1,\n",
      "        \"end_i\": 25063015,\n",
      "        \"start_i\": 25051520,\n",
      "        \"tx_ac\": \"NR_045951.1\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.10\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"alt_strand\": -1,\n",
      "        \"end_i\": 25063015,\n",
      "        \"start_i\": 25051520,\n",
      "        \"tx_ac\": \"NM_001256271.1\"\n",
      "    }\n",
      "]\n"
     ]
    }
   ],
   "source": [
    "pj(hdp.get_tx_for_region(\"NC_000020.10\", \"splign\", 25059178, 25059588))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_tx_identity_info\n",
    "\n",
    "Uses:\n",
    "* hgvs/alignmentmapper.py\n",
    "* hgvs/validator.py\n",
    "* hgvs/normalizer.py\n",
    "* hgvs/utils/reftranscriptdata.py\n",
    "* hgvs/transcriptmapper.py\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\n",
      "    \"alt_ac\": \"NM_001256272.1\",\n",
      "    \"alt_aln_method\": \"transcript\",\n",
      "    \"cds_end_i\": 1189,\n",
      "    \"cds_start_i\": 283,\n",
      "    \"hgnc\": \"VSX1\",\n",
      "    \"lengths\": [\n",
      "        707,\n",
      "        79,\n",
      "        124,\n",
      "        181,\n",
      "        1134\n",
      "    ],\n",
      "    \"tx_ac\": \"NM_001256272.1\"\n",
      "}\n"
     ]
    }
   ],
   "source": [
    "pj(hdp.get_tx_identity_info(\"NM_001256272.1\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_tx_info\n",
    "\n",
    "Uses:\n",
    "* hgvs/alignmentmapper.py\n",
    "* hgvs/normalizer.py\n",
    "* hgvs/transcriptmapper.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\n",
      "    \"alt_ac\": \"NC_000020.10\",\n",
      "    \"alt_aln_method\": \"splign\",\n",
      "    \"cds_end_i\": 1189,\n",
      "    \"cds_start_i\": 283,\n",
      "    \"hgnc\": \"VSX1\",\n",
      "    \"tx_ac\": \"NM_001256272.1\"\n",
      "}\n"
     ]
    }
   ],
   "source": [
    "pj(hdp.get_tx_info(\"NM_001256272.1\", \"NC_000020.10\", \"splign\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_tx_mapping_options\n",
    "\n",
    "Uses:\n",
    "* hgvs/normalizer.py\n",
    "* hgvs/assemblymapper.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[\n",
      "    {\n",
      "        \"alt_ac\": \"NM_001256272.1\",\n",
      "        \"alt_aln_method\": \"transcript/4d52a1d2\",\n",
      "        \"tx_ac\": \"NM_001256272.1\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.10\",\n",
      "        \"alt_aln_method\": \"blat\",\n",
      "        \"tx_ac\": \"NM_001256272.1\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_018931.2\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"tx_ac\": \"NM_001256272.1\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.11\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"tx_ac\": \"NM_001256272.1\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"NC_000020.10\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"tx_ac\": \"NM_001256272.1\"\n",
      "    },\n",
      "    {\n",
      "        \"alt_ac\": \"AC_000152.1\",\n",
      "        \"alt_aln_method\": \"splign\",\n",
      "        \"tx_ac\": \"NM_001256272.1\"\n",
      "    }\n",
      "]\n"
     ]
    }
   ],
   "source": [
    "pj(hdp.get_tx_mapping_options(\"NM_001256272.1\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_similar_transcripts\n",
    "\n",
    "Uses: Not used by hgvs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[\n",
      "    {\n",
      "        \"cds_eq\": false,\n",
      "        \"cds_es_fp_eq\": false,\n",
      "        \"cds_exon_lengths_fp_eq\": false,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"ENST00000398332\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": null,\n",
      "        \"cds_es_fp_eq\": null,\n",
      "        \"cds_exon_lengths_fp_eq\": null,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"ENST00000409958\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": false,\n",
      "        \"cds_es_fp_eq\": false,\n",
      "        \"cds_exon_lengths_fp_eq\": false,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"ENST00000424574\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": false,\n",
      "        \"cds_es_fp_eq\": false,\n",
      "        \"cds_exon_lengths_fp_eq\": false,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"ENST00000451258\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": false,\n",
      "        \"cds_es_fp_eq\": false,\n",
      "        \"cds_exon_lengths_fp_eq\": false,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"NM_199425.2\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": false,\n",
      "        \"cds_es_fp_eq\": false,\n",
      "        \"cds_exon_lengths_fp_eq\": false,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"NM_001256271.1\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": false,\n",
      "        \"cds_es_fp_eq\": false,\n",
      "        \"cds_exon_lengths_fp_eq\": false,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"ENST00000376709\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": false,\n",
      "        \"cds_es_fp_eq\": false,\n",
      "        \"cds_exon_lengths_fp_eq\": false,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"ENST00000444511\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": null,\n",
      "        \"cds_es_fp_eq\": null,\n",
      "        \"cds_exon_lengths_fp_eq\": null,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"ENST00000409285\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": null,\n",
      "        \"cds_es_fp_eq\": null,\n",
      "        \"cds_exon_lengths_fp_eq\": null,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"NR_045951.1\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": null,\n",
      "        \"cds_es_fp_eq\": null,\n",
      "        \"cds_exon_lengths_fp_eq\": null,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"NR_045948.1\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": null,\n",
      "        \"cds_es_fp_eq\": null,\n",
      "        \"cds_exon_lengths_fp_eq\": null,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"ENST00000557285\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": false,\n",
      "        \"cds_es_fp_eq\": false,\n",
      "        \"cds_exon_lengths_fp_eq\": false,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"NM_014588.5\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": false,\n",
      "        \"cds_es_fp_eq\": false,\n",
      "        \"cds_exon_lengths_fp_eq\": false,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"ENST00000376707\"\n",
      "    },\n",
      "    {\n",
      "        \"cds_eq\": true,\n",
      "        \"cds_es_fp_eq\": false,\n",
      "        \"cds_exon_lengths_fp_eq\": true,\n",
      "        \"es_fp_eq\": false,\n",
      "        \"hgnc_eq\": true,\n",
      "        \"tx_ac1\": \"NM_001256272.1\",\n",
      "        \"tx_ac2\": \"ENST00000429762\"\n",
      "    }\n",
      "]\n"
     ]
    }
   ],
   "source": [
    "pj(hdp.get_similar_transcripts(\"NM_001256272.1\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# get_pro_ac_for_tx_ac\n",
    "\n",
    "Uses:\n",
    "* hgvs/utils/reftranscriptdata.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'NP_001243201.1'"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hdp.get_pro_ac_for_tx_ac(\"NM_001256272.1\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
